<?php
    require_once("inc_security.php");
	$left = $_POST['x'];
	$top = $_POST['y'];
	$width = $_POST['ImgWidth'];
	$height = $_POST['ImgHeight'];
	$count = $_POST['count'];
	$newImgName = $count.'crop';
	$currentPath = $path.'Temp/'.$_POST['currentLink'];
	$name = FileHelper::GetFileName($currentPath);
	$ext=FileHelper::GetFileExtension($currentPath);
		$imgName = $newImgName.'.'.$ext;

	$saveImg = $path.'Temp/'.$imgName;
	$savePath =$saveImg;
	
		ImageHelper::Crop($currentPath, $savePath, $left, $top, $width, $height, $ext);
	echo$imgName;
?>